using System;
using System.Drawing;
using Wilco.SyntaxHighlighting.Engine.Highlighter;
using Wilco.SyntaxHighlighting.Engine.Node.Implementation.String;
using Wilco.SyntaxHighlighting.Engine.Node.Implementation.Word;
using Wilco.SyntaxHighlighting.Engine.Parser;
using Wilco.SyntaxHighlighting.Engine.Scanner;
using Wilco.SyntaxHighlighting.Engine.Scanner.Implementation;

namespace Wilco.SyntaxHighlighting.Engine.Highlighter.Implementation
{
    /// <summary>
    /// Represents a SQL syntax highlighter.
    /// </summary>
    public class SQLHighlighter : HighlighterBase
    {
        /// <summary>
        /// Initializes a new instance of a <see cref="SQLHighlighter"/> class.
        /// </summary>
        public SQLHighlighter() : this(null)
        {
        }

        /// <summary>
        /// Initializes a new instance of a <see cref="SQLHighlighter"/> class.
        /// </summary>
        /// <param name="parser">The parser which will be used to parse the source code.</param>
        public SQLHighlighter(IParser parser) : base(parser)
        {
            Name = "SQL";
            FullName = "SQL";
            TagValues.AddRange(new String[] { "sql" });
            FileExtensions.Add("sql");
        }

        /// <summary>
        /// Creates a new instance (clone) of this highlighter.
        /// </summary>
        /// <returns></returns>
        public override HighlighterBase Create()
        {
            return new SQLHighlighter(Parser);
        }

        /// <summary>
        /// Builds a word scanner.
        /// </summary>
        /// <returns>A <see cref="WordScanner"/> object.</returns>
        protected override IScanner BuildWordScanner()
        {
            WordScanner scanner = new WordScanner(Tokenizer, ScannerResult);
            scanner.WordNodes = new WordNode[2];
            scanner.WordNodes[0] = new WordNode();
            scanner.WordNodes[0].IgnoreCase = true;
            scanner.WordNodes[0].ForeColor = Color.Blue;
            scanner.WordNodes[0].Entities.AddRange(GetKeywords());
            //scanner.WordNodes[0].NavigateUrl = "http://search.microsoft.com/default.asp?so=RECCNT&siteid=us%2Fdev&p=1&nq=NEW&qu={0}&IntlSearch=&boolean=PHRASE&ig=01&i=09&i=99";
            scanner.WordNodes[1] = new WordNode();
            scanner.WordNodes[1].IgnoreCase = true;
            scanner.WordNodes[1].ForeColor = Color.Orange;
            scanner.WordNodes[1].Entities.AddRange(GetStoredProcedures());
            //scanner.WordNodes[1].NavigateUrl = "http://search.microsoft.com/default.asp?so=RECCNT&siteid=us%2Fdev&p=1&nq=NEW&qu={0}&IntlSearch=&boolean=PHRASE&ig=01&i=09&i=99";
            return scanner;
        }

        /// <summary>
        /// Builds a comment line scanner.
        /// </summary>
        /// <returns>A <see cref="CommentLineScanner"/> object.</returns>
        protected override IScanner BuildCommentLineScanner()
        {
            CommentLineScanner scanner = new CommentLineScanner(Tokenizer, ScannerResult);
            scanner.CommentLineNode.ForeColor = Color.Green;
            scanner.CommentLineNode.Entities.Add("--");
            return scanner;
        }

        /// <summary>
        /// Builds a string scanner.
        /// </summary>
        /// <returns>The string scanner.</returns>
        protected override IScanner BuildStringScanner()
        {
            StringLineScanner stringScanner = (StringLineScanner)base.BuildStringScanner();
            stringScanner.StringNode.Entities.Add(new StringEntity("'", "'", "'"));
            return stringScanner;
        }

        /// <summary>
        /// Gets an array of registered keywords.
        /// </summary>
        /// <returns>An array of keywords.</returns>
        private static string[] GetKeywords()
        {
            string[] keywordList = new string[]
                {
                    "RETURNS",
                    "FUNCTION",
                    "bigint",
                    "binary",
                    "bit",
                    "char",
                    "datetime",
                    "decimal",
                    "float",
                    "image",
                    "int",
                    "money",
                    "nchar",
                    "ntext",
                    "numeric",
                    "nvarchar",
                    "real",
                    "smalldatetime",
                    "smallint",
                    "smallmoney",
                    "sql_variant",
                    "text",
                    "timestamp",
                    "tinyint",
                    "uniqueidentifier",
                    "varbinary",
                    "varchar",
                    "ADD",
                    "EXIT",
                    "PRIMARY",
                    "ALL",
                    "FETCH",
                    "PRINT",
                    "ALTER",
                    "FILE",
                    "PRIVILEGES",
                    "AND",
                    "FILLFACTOR",
                    "PROC",
                    "ANY",
                    "FLOPPY",
                    "PROCEDURE",
                    "AS",
                    "FOR",
                    "PROCESSEXIT",
                    "ASC",
                    "FOREIGN",
                    "PUBLIC",
                    "AUTHORIZATION",
                    "FREETEXT",
                    "RAISERROR",
                    "AVG",
                    "FREETEXTTABLE",
                    "READ",
                    "BACKUP",
                    "FROM",
                    "READTEXT",
                    "BEGIN",
                    "FULL",
                    "RECONFIGURE",
                    "BETWEEN",
                    "GOTO",
                    "REFERENCES",
                    "BREAK",
                    "GRANT",
                    "REPEATABLE",
                    "BROWSE",
                    "GROUP",
                    "REPLICATION",
                    "BULK",
                    "HAVING",
                    "RESTORE",
                    "BY",
                    "HOLDLOCK",
                    "RESTRICT",
                    "CASCADE",
                    "IDENTITY",
                    "RETURN",
                    "CASE",
                    "IDENTITY_INSERT",
                    "REVOKE",
                    "CHECK",
                    "IDENTITYCOL",
                    "RIGHT",
                    "CHECKPOINT",
                    "IF",
                    "ROLLBACK",
                    "CLOSE",
                    "IN",
                    "ROWCOUNT",
                    "CLUSTERED",
                    "INDEX",
                    "ROWGUIDCOL",
                    "COALESCE",
                    "INNER",
                    "RULE",
                    "COLUMN",
                    "INSERT",
                    "SAVE",
                    "COMMIT",
                    "INTERSECT",
                    "SCHEMA",
                    "COMMITTED",
                    "INTO",
                    "SELECT",
                    "COMPUTE",
                    "IS",
                    "SERIALIZABLE",
                    "CONFIRM",
                    "ISOLATION",
                    "SESSION_USER",
                    "CONSTRAINT",
                    "JOIN",
                    "SET",
                    "CONTAINS",
                    "KEY",
                    "SETUSER",
                    "CONTAINSTABLE",
                    "KILL",
                    "SHUTDOWN",
                    "CONTINUE",
                    "LEFT",
                    "SOME",
                    "CONTROLROW",
                    "LEVEL",
                    "STATISTICS",
                    "CONVERT",
                    "LIKE",
                    "SUM",
                    "COUNT",
                    "LINENO",
                    "SYSTEM_USER",
                    "CREATE",
                    "LOAD",
                    "TABLE",
                    "CROSS",
                    "MAX",
                    "TAPE",
                    "CURRENT",
                    "MIN",
                    "TEMP",
                    "CURRENT_DATE",
                    "MIRROREXIT",
                    "TEMPORARY",
                    "CURRENT_TIME",
                    "NATIONAL",
                    "TEXTSIZE",
                    "CURRENT_TIMESTAMP",
                    "NOCHECK",
                    "THEN",
                    "CURRENT_USER",
                    "NONCLUSTERED",
                    "TO",
                    "CURSOR",
                    "NOT",
                    "TOP",
                    "DATABASE",
                    "NULL",
                    "TRAN",
                    "DBCC",
                    "NULLIF",
                    "TRANSACTION",
                    "DEALLOCATE",
                    "OF",
                    "TRIGGER",
                    "DECLARE",
                    "OFF",
                    "TRUNCATE",
                    "DEFAULT",
                    "OFFSETS",
                    "TSEQUAL",
                    "DELETE",
                    "ON",
                    "UNCOMMITTED",
                    "DENY",
                    "ONCE",
                    "UNION",
                    "DESC",
                    "ONLY",
                    "UNIQUE",
                    "DISK",
                    "OPEN",
                    "UPDATE",
                    "DISTINCT",
                    "OPENDATASOURCE",
                    "UPDATETEXT",
                    "DISTRIBUTED",
                    "OPENQUERY",
                    "USE",
                    "DOUBLE",
                    "OPENROWSET",
                    "USER",
                    "DROP",
                    "OPTION",
                    "VALUES",
                    "DUMMY",
                    "OR",
                    "VARYING",
                    "DUMP",
                    "ORDER",
                    "VIEW",
                    "ELSE",
                    "OUTER",
                    "WAITFOR",
                    "END",
                    "OVER",
                    "WHEN",
                    "ERRLVL",
                    "PERCENT",
                    "WHERE",
                    "ERROREXIT",
                    "PERM",
                    "WHILE",
                    "ESCAPE",
                    "PERMANENT",
                    "WITH",
                    "EXCEPT",
                    "PIPE",
                    "WORK",
                    "EXEC",
                    "PLAN",
                    "WRITETEXT",
                    "EXECUTE",
                    "PRECISION",
                    "EXISTS",
                    "PREPARE",
                    "ABSOLUTE",
                    "EXEC",
                    "OVERLAPS",
                    "ACTION",
                    "EXECUTE",
                    "PAD",
                    "ADA",
                    "EXISTS",
                    "PARTIAL",
                    "ADD",
                    "EXTERNAL",
                    "PASCAL",
                    "ALL",
                    "EXTRACT",
                    "POSITION",
                    "ALLOCATE",
                    "FALSE",
                    "PRECISION",
                    "ALTER",
                    "FETCH",
                    "PREPARE",
                    "AND",
                    "FIRST",
                    "PRESERVE",
                    "ANY",
                    "FLOAT",
                    "PRIMARY",
                    "ARE",
                    "FOR",
                    "PRIOR",
                    "AS",
                    "FOREIGN",
                    "PRIVILEGES",
                    "ASC",
                    "FORTRAN",
                    "PROCEDURE",
                    "ASSERTION",
                    "FOUND",
                    "PUBLIC",
                    "AT",
                    "FROM",
                    "READ",
                    "AUTHORIZATION",
                    "FULL",
                    "REAL",
                    "AVG",
                    "GET",
                    "REFERENCES",
                    "BEGIN",
                    "GLOBAL",
                    "RELATIVE",
                    "BETWEEN",
                    "GO",
                    "RESTRICT",
                    "BIT",
                    "GOTO",
                    "REVOKE",
                    "BIT_LENGTH",
                    "GRANT",
                    "RIGHT",
                    "BOTH",
                    "GROUP",
                    "ROLLBACK",
                    "BY",
                    "HAVING",
                    "ROWS",
                    "CASCADE",
                    "HOUR",
                    "SCHEMA",
                    "CASCADED",
                    "IDENTITY",
                    "SCROLL",
                    "CASE",
                    "IMMEDIATE",
                    "SECOND",
                    "CAST",
                    "IN",
                    "SECTION",
                    "CATALOG",
                    "INCLUDE",
                    "SELECT",
                    "CHAR",
                    "INDEX",
                    "SESSION",
                    "CHAR_LENGTH",
                    "INDICATOR",
                    "SESSION_USER",
                    "CHARACTER",
                    "INITIALLY",
                    "SET",
                    "CHARACTER_LENGTH",
                    "INNER",
                    "SIZE",
                    "CHECK",
                    "INPUT",
                    "SMALLINT",
                    "CLOSE",
                    "INSENSITIVE",
                    "SOME",
                    "COALESCE",
                    "INSERT",
                    "SPACE",
                    "COLLATE",
                    "INT",
                    "SQL",
                    "COLLATION",
                    "INTEGER",
                    "SQLCA",
                    "COLUMN",
                    "INTERSECT",
                    "SQLCODE",
                    "COMMIT",
                    "INTERVAL",
                    "SQLERROR",
                    "CONNECT",
                    "INTO",
                    "SQLSTATE",
                    "CONNECTION",
                    "IS",
                    "SQLWARNING",
                    "CONSTRAINT",
                    "ISOLATION",
                    "SUBSTRING",
                    "CONSTRAINTS",
                    "JOIN",
                    "SUM",
                    "CONTINUE",
                    "KEY",
                    "SYSTEM_USER",
                    "CONVERT",
                    "LANGUAGE",
                    "TABLE",
                    "CORRESPONDING",
                    "LAST",
                    "TEMPORARY",
                    "COUNT",
                    "LEADING",
                    "THEN",
                    "CREATE",
                    "LEFT",
                    "TIME",
                    "CROSS",
                    "LEVEL",
                    "TIMESTAMP",
                    "CURRENT",
                    "LIKE",
                    "TIMEZONE_HOUR",
                    "CURRENT_DATE",
                    "LOCAL",
                    "TIMEZONE_MINUTE",
                    "CURRENT_TIME",
                    "LOWER",
                    "TO",
                    "CURRENT_TIMESTAMP",
                    "MATCH",
                    "TRAILING",
                    "CURRENT_USER",
                    "MAX",
                    "TRANSACTION",
                    "CURSOR",
                    "MIN",
                    "TRANSLATE",
                    "DATE",
                    "MINUTE",
                    "TRANSLATION",
                    "DAY",
                    "MODULE",
                    "TRIM",
                    "DEALLOCATE",
                    "MONTH",
                    "TRUE",
                    "DEC",
                    "NAMES",
                    "UNION",
                    "DECIMAL",
                    "NATIONAL",
                    "UNIQUE",
                    "DECLARE",
                    "NATURAL",
                    "UNKNOWN",
                    "DEFAULT",
                    "NCHAR",
                    "UPDATE",
                    "DEFERRABLE",
                    "NEXT",
                    "UPPER",
                    "DEFERRED",
                    "NO",
                    "USAGE",
                    "DELETE",
                    "NONE",
                    "USER",
                    "DESC",
                    "NOT",
                    "USING",
                    "DESCRIBE",
                    "NULL",
                    "VALUE",
                    "DESCRIPTOR",
                    "NULLIF",
                    "VALUES",
                    "DIAGNOSTICS",
                    "NUMERIC",
                    "VARCHAR",
                    "DISCONNECT",
                    "OCTET_LENGTH",
                    "VARYING",
                    "DISTINCT",
                    "OF",
                    "VIEW",
                    "DOMAIN",
                    "ON",
                    "WHEN",
                    "DOUBLE",
                    "ONLY",
                    "WHENEVER",
                    "DROP",
                    "OPEN",
                    "WHERE",
                    "ELSE",
                    "OPTION",
                    "WITH",
                    "END",
                    "OR",
                    "WORK",
                    "END-EXEC",
                    "ORDER",
                    "WRITE",
                    "ESCAPE",
                    "OUTER",
                    "YEAR",
                    "EXCEPT",
                    "OUTPUT",
                    "ZONE",
                    "EXCEPTION"
                };

            Array.Sort(keywordList);
            Array.Reverse(keywordList);

            return keywordList;
        }

        /// <summary>
        /// Gets an array of registered stored procedures.
        /// </summary>
        /// <returns>An array of stored procedures.</returns>
        private static string[] GetStoredProcedures()
        {
            string[] spList = new String[]
                {
                    "sp_dropsubscriber",
                    "sp_remove_tempdb_file",
                    "sp_vupgrade_subscription_tables",
                    "sp_MS_marksystemobject",
                    "sp_MSvalidatearticle",
                    "sp_MSreplcheckoffloadserver",
                    "sp_helpmergesubscription",
                    "xp_getfiledetails",
                    "sp_MSscript_insert_subwins",
                    "sp_dsninfo",
                    "sp_rename",
                    "sp_vupgrade_mergetables",
                    "sp_MS_upd_sysobj_category",
                    "sp_MSsubscriptionvalidated",
                    "fn_repluniquename",
                    "sp_dropmergesubscription",
                    "xp_servicecontrol",
                    "sp_MSis_identity_insert",
                    "sp_publishdb",
                    "sp_resetstatus",
                    "sp_vupgrade_subpass",
                    "sp_db_upgrade",
                    "sp_MSdroparticletombstones",
                    "sp_MSget_file_existence",
                    "sp_MShelpvalidationdate",
                    "xp_availablemedia",
                    "sp_MSscript_compensating_send",
                    "sp_MScreate_dist_tables",
                    "sp_add_file_recover_suspect_db",
                    "sp_vupgrade_MSsubscription_properties",
                    "sp_MSproxiedmetadata",
                    "sp_MSrepl_isdbowner",
                    "sp_MSmergepublishdb",
                    "xp_dirtree",
                    "sp_MSscript_insert_pubwins",
                    "sp_special_columns",
                    "sp_MSupdate_mqserver_distdb",
                    "sp_add_data_file_recover_suspect_db",
                    "sp_vupgrade_replication",
                    "sp_MScontractsubsnb",
                    "sp_resyncmergesubscription",
                    "sp_enumcustomresolvers",
                    "xp_eventlog",
                    "sp_MSscript_update_statement",
                    "sp_MSadd_distributor_alerts_and_responses",
                    "sp_add_log_file_recover_suspect_db",
                    "sp_vupgrade_distdb",
                    "sp_MSexpandsubsnb",
                    "sp_MSget_qualified_name",
                    "sp_changemergefilter",
                    "sp_eventlog",
                    "sp_MSscript_update_subwins",
                    "sp_MSdrop_distributor_alerts_and_responses",
                    "sp_spaceused",
                    "sp_vupgrade_publisher",
                    "sp_MSdelsubrows",
                    "sp_MSdrop_object",
                    "sp_addmergefilter",
                    "xp_fixeddrives",
                    "sp_MSscript_update_pubwins",
                    "sp_adddistributor",
                    "sp_sqlexec",
                    "sp_vupgrade_syscol_status",
                    "sp_MSdelsubrowsbatch",
                    "sp_isarticlecolbitset",
                    "sp_dropmergefilter",
                    "xp_subdirs",
                    "sp_MSscript_delete_statement",
                    "sp_sproc_columns",
                    "sp_changedistributor_property",
                    "sp_unbindefault",
                    "sp_vupgrade_publisherdb",
                    "sp_MSmakeviewproc",
                    "sp_getarticlepkcolbitmap",
                    "sp_helpmergefilter",
                    "xp_getnetname",
                    "sp_MSscript_delete_subwins",
                    "sp_helpdistributor_properties",
                    "sp_unbindrule",
                    "sp_vupgrade_replmsdb",
                    "sp_MScreatebeforetable",
                    "sp_MSsubst_filter_name",
                    "sp_MSscript_dri",
                    "sp_IsMBCSLeadByte",
                    "sp_MSscript_compensating_insert",
                    "sp_dropdistributor",
                    "sp_who",
                    "sp_restoredbreplication",
                    "sp_dropextendedproc",
                    "sp_MShelpcreatebeforetable",
                    "sp_MSsubst_filter_names",
                    "sp_MSenumpubreferences",
                    "sp_GetMBCSCharLen",
                    "sp_MSscript_delete_pubwins",
                    "sp_statistics",
                    "sp_helpdistributiondb",
                    "sp_who2",
                    "sp_MSget_publisher_rpc",
                    "sp_addextendedproc",
                    "sp_MShelpalterbeforetable",
                    "sp_MSreplcheck_name",
                    "sp_MSsubsetpublication",
                    "xp_sqlagent_monitor",
                    "sp_MSscript_beginproc",
                    "sp_changedistributiondb",
                    "sp_check_removable",
                    "sp_link_publication",
                    "sp_helpextendedproc",
                    "sp_MSgetbeforetableinsert",
                    "sp_MScheckvalidsystables",
                    "sp_MSindexcolfrombin",
                    "xp_sqlagent_notify",
                    "sp_MSscript_security",
                    "sp_dropdistributiondb",
                    "sp_certify_removable",
                    "sp_MSreset_queue",
                    "xp_cmdshell",
                    "sp_MSfixupbeforeimagetables",
                    "sp_MSdrop_mergesystables",
                    "sp_MSmakejoinfilter",
                    "xp_sqlagent_enum_jobs",
                    "sp_MSscript_endproc",
                    "sp_stored_procedures",
                    "sp_adddistributiondb",
                    "MS_sqlctrs_users",
                    "sp_MSreset_queued_reinit",
                    "xp_logevent",
                    "sp_MSreplcheck_permission",
                    "sp_MScreate_mergesystables",
                    "sp_MSmakeexpandproc",
                    "xp_sqlagent_is_starting",
                    "sp_MStable_not_modifiable",
                    "sp_dropdistpublisher",
                    "sp_autostats",
                    "sp_MSinit_subscription_agent",
                    "xp_sprintf",
                    "sp_MSinserterrorlineage",
                    "sp_MStestbit",
                    "sp_MSdrop_expired_mergesubscription",
                    "xp_sqlagent_param",
                    "sp_MSscript_ExecutionMode_stmt",
                    "sp_adddistpublisher",
                    "sp_updatestats",
                    "sp_MSupdatelastsyncinfo",
                    "xp_sscanf",
                    "sp_MSevalsubscriberinfo",
                    "sp_MSsetbit",
                    "sp_MScleanup_metadata",
                    "xp_sqlagent_proxy_account",
                    "sp_MSscript_sync_ins_proc",
                    "sp_table_privileges",
                    "sp_changedistpublisher",
                    "sp_createstats",
                    "sp_MSget_attach_state",
                    "xp_msver",
                    "sp_MSsetsubscriberinfo",
                    "sp_MSinsertcontents",
                    "sp_helpmergecleanupwait",
                    "xp_enum_activescriptengines",
                    "sp_MSscript_sync_upd_proc",
                    "sp_helpdistpublisher",
                    "sp_cycle_errorlog",
                    "sp_MSreset_attach_state",
                    "xp_enumgroups",
                    "sp_MSgetsubscriberinfo",
                    "sp_MSupdatecontents",
                    "sp_MSquiescecheck",
                    "xp_fileexist",
                    "sp_MSscript_sync_del_proc",
                    "sp_tables",
                    "sp_add_agent_profile",
                    "sp_helptrigger",
                    "sp_MSset_subscription_properties",
                    "xp_loginconfig",
                    "sp_MSmakectsview",
                    "sp_MSdeletecontents",
                    "sp_mergepreparecleanup",
                    "xp_ntsec_enumdomains",
                    "sp_MSscript_pub_upd_trig",
                    "sp_linkedservers",
                    "sp_drop_agent_parameter",
                    "sp_fixindex",
                    "sp_MSset_sub_guid",
                    "sp_cursor",
                    "sp_MSinsertgenerationschemachanges",
                    "sp_MSunmarkifneeded",
                    "sp_MSpreparecleanup",
                    "xp_terminate_process",
                    "sp_MSmakeconflicttable",
                    "sp_catalogs",
                    "sp_drop_agent_profile",
                    "sp_settriggerorder",
                    "sp_MScreate_sub_tables",
                    "sp_cursorclose",
                    "sp_MSalreadyhavegeneration",
                    "sp_MSunmarkreplinfo",
                    "sp_MSquiescetriggerson",
                    "xp_msx_enlist",
                    "sp_scriptsubconflicttable",
                    "sp_tables_ex",
                    "sp_help_agent_profile",
                    "fn_listextendedproperty",
                    "sp_MSupdate_mqserver_subdb",
                    "sp_cursorfetch",
                    "sp_MSgettablecontents",
                    "sp_MSmarkreplinfo",
                    "sp_MSquiescetriggersoff",
                    "xp_sqlmaint",
                    "sp_MSgen_sync_tran_procs",
                    "sp_help_agent_default",
                    "sp_validatepropertyinputs",
                    "sp_MS_replication_installed",
                    "sp_cursoropen",
                    "sp_MSdelgenzero",
                    "sp_MSunmarkschemaobject",
                    "sp_MSquiesceforcleanup",
                    "xp_get_tape_devices",
                    "sp_articlesynctranprocs",
                    "sp_columns_ex",
                    "sp_MSupdate_agenttype_default",
                    "sp_addextendedproperty",
                    "sp_MSunc_to_drive",
                    "sp_cursoroption",
                    "sp_MSmakedynsnapshotvws",
                    "sp_MSmarkschemaobject",
                    "sp_mergecompletecleanup",
                    "xp_enum_oledb_providers",
                    "sp_reinitsubscription",
                    "sp_table_privileges_ex",
                    "sp_generate_agent_parameter",
                    "sp_updateextendedproperty",
                    "sp_MSretrieve_publication_attributes",
                    "sp_bindsession",
                    "sp_MSdropdynsnapshotvws",
                    "sp_MSaddanonymousreplica",
                    "sp_MScompletecleanup",
                    "sp_enum_oledb_providers",
                    "sp_MSareallcolumnscomputed",
                    "sp_column_privileges_ex",
                    "sp_MSvalidate_agent_parameter",
                    "sp_dropextendedproperty",
                    "sp_MScleanup_publication_ADinfo",
                    "sp_getbindtoken",
                    "sp_MSgetreplicainfo",
                    "sp_MSpropagateschematorepubs",
                    "xp_prop_oledb_provider",
                    "sp_MSgettypestringudt",
                    "sp_indexes",
                    "sp_add_agent_parameter",
                    "sp_addlogin",
                    "sp_MSrepl_linkedservers_rowset",
                    "sp_createorphan",
                    "pk_dtproperties",
                    "sp_MSadd_repl_job",
                    "sp_mergecleanupmetadata",
                    "sp_prop_oledb_provider",
                    "sp_gettypestring",
                    "sp_foreignkeys",
                    "sp_change_agent_parameter",
                    "sp_password",
                    "sp_MSregistersubscription",
                    "sp_droporphans",
                    "DF__dtpropert__versi__1B13F4C6",
                    "sp_MScheck_subscription",
                    "sp_MScleanup_conflict_table",
                    "xp_updateFTSSQLAccount",
                    "sp_scriptpkwhereclause",
                    "sp_primarykeys",
                    "sp_change_agent_profile",
                    "sp_droplogin",
                    "sp_MSunregistersubscription",
                    "sp_xml_preparedocument",
                    "dt_generateansiname",
                    "sp_MSgettools_path",
                    "sp_validatemergesubscription",
                    "sp_MSgetversion",
                    "sp_MSscript_missing_row_check",
                    "sp_help_agent_parameter",
                    "sp_MSaddlogin_implicit_ntlogin",
                    "sp_MSsubscription_enabled_for_syncmgr",
                    "sp_xml_removedocument",
                    "dt_adduserobject",
                    "sp_replicationoption",
                    "sp_validatemergepublication",
                    "xp_unc_to_drive",
                    "sp_scriptupdateparams",
                    "sp_MShelp_distdb",
                    "sp_grantlogin",
                    "sp_MSget_jobstate",
                    "sp_trace_create",
                    "dt_setpropertybyid",
                    "sp_helpreplicationoption",
                    "sp_MScleanup_conflict",
                    "xp_MSplatform",
                    "sp_scriptreconwhereclause",
                    "sp_ddopen",
                    "sp_MSupdate_replication_status",
                    "sp_validatelogins",
                    "sp_MSscript_pkvar_assignment",
                    "sp_trace_setevent",
                    "dt_getobjwithprop",
                    "sp_MSgetreplnick",
                    "sp_generatefilters",
                    "xp_MSFullText",
                    "sp_script_reconciliation_insproc",
                    "sp_MSenum_misc_agents",
                    "xp_grantlogin",
                    "sp_MSget_publication_from_taskname",
                    "sp_trace_setfilter",
                    "dt_getpropertiesbyid",
                    "sp_MSreplcheck_publish",
                    "sp_MShelpmergeconflictcounts",
                    "xp_IsNTAdmin",
                    "sp_script_reconciliation_delproc",
                    "sp_tableswc",
                    "sp_MSload_replication_status",
                    "sp_denylogin",
                    "sp_MSacquireHeadofQueueLock",
                    "sp_trace_setstatus",
                    "dt_setpropertybyid_u",
                    "sp_MSlocktable",
                    "sp_MShelpmergeconflictpublications",
                    "xp_SetSQLSecurity",
                    "sp_script_reconciliation_xdelproc",
                    "sp_MScreate_replication_status_table",
                    "sp_revokelogin",
                    "sp_MSacquireSlotLock",
                    "sp_trace_generateevent",
                    "dt_getobjwithprop_u",
                    "sp_MSenumcolumns",
                    "sp_MSclearcolumnbit",
                    "xp_GetAdminGroupName",
                    "sp_scriptinsproc",
                    "sp_add_server_sortinfo",
                    "sp_MShelp_replication_status",
                    "xp_revokelogin",
                    "sp_MSreleaseSlotLock",
                    "sp_sdidebug",
                    "dt_getpropertiesbyid_u",
                    "sp_MSsetaccesslist",
                    "sp_helpmergearticleconflicts",
                    "xp_MSnt2000",
                    "sp_scriptdelproc",
                    "sp_add_server_sortinfo75",
                    "sp_MSenum_replication_agents",
                    "sp_defaultdb",
                    "sp_MSrepl_check_server",
                    "sp_executesql",
                    "dt_dropuserobjectbyid",
                    "sp_MSreplcheck_pull",
                    "sp_helpmergeconflictrows",
                    "xp_MSADEnabled",
                    "sp_scriptxdelproc",
                    "sp_replication_agent_checkup",
                    "sp_defaultlanguage",
                    "sp_MSreset_synctran_bit",
                    "xp_userlock",
                    "dt_droppropertiesbyid",
                    "sp_MSreplcheck_connection",
                    "sp_helpmergedeleteconflictrows",
                    "xp_MSADSIReg",
                    "sp_scriptupdproc",
                    "sp_catalogs_rowset",
                    "sp_MScreate_replication_checkup_agent",
                    "sp_addsrvrolemember",
                    "sp_MSenum_replsqlqueues",
                    "sp_prepare",
                    "dt_verstamp006",
                    "sp_MSreplcheck_qv",
                    "sp_deletemergeconflictrow",
                    "xp_MSADSIObjReg",
                    "sp_scriptmappedupdproc",
                    "sp_MSenum_replication_job",
                    "sp_dropsrvrolemember",
                    "sp_MSenum_replqueues",
                    "sp_execute",
                    "dt_verstamp007",
                    "sp_reinitmergepullsubscription",
                    "sp_getmergedeletetype",
                    "xp_MSADSIObjRegDB",
                    "sp_scriptdynamicupdproc",
                    "sp_column_privileges_rowset",
                    "sp_MSrepl_dbrole",
                    "sp_MSadduser_implicit_ntlogin",
                    "sp_browsemergesnapshotfolder",
                    "sp_prepexec",
                    "dt_getpropertiesbyid_vcs",
                    "sp_MSreplcheck_subscribe",
                    "sp_mergedummyupdate",
                    "xp_MSLocalSystem",
                    "sp_scriptxupdproc",
                    "sp_changedistributor_password",
                    "sp_MScheck_uid_owns_anything",
                    "sp_browsesnapshotfolder",
                    "sp_prepexecrpc",
                    "dt_displayoaerror",
                    "sp_MSreplicationcompatlevel",
                    "sp_addtabletocontents",
                    "xp_adsirequest",
                    "sp_MSscriptmvastablenci",
                    "sp_oledbinfo",
                    "sp_grantdbaccess",
                    "sp_MScopysnapshot",
                    "sp_unprepare",
                    "dt_adduserobject_vcs",
                    "sp_MShelp_identity_property",
                    "sp_MSaddpubtocontents",
                    "sp_ActiveDirectory_Start",
                    "sp_MSscriptmvastablepkc",
                    "sp_columns_rowset",
                    "sp_MSget_oledbinfo",
                    "sp_adduser",
                    "sp_copymergesnapshot",
                    "sp_cursorprepare",
                    "dt_addtosourcecontrol",
                    "sp_MSgenreplnickname",
                    "sp_MSget_subtypedatasrc",
                    "sp_ActiveDirectory_SCP",
                    "sp_MSscriptmvastableidx",
                    "sp_grant_publication_access",
                    "sp_revokedbaccess",
                    "sp_copysnapshot",
                    "sp_cursorexecute",
                    "dt_checkinobject",
                    "sp_MSmergesubscribedb",
                    "sp_addmergealternatepublisher",
                    "sp_ActiveDirectory_Obj",
                    "sp_MSscriptmvastable",
                    "sp_check_constraints_rowset",
                    "sp_revoke_publication_access",
                    "sp_dropuser",
                    "sp_MSrepl_validate_dts_package",
                    "sp_cursorprepexec",
                    "dt_checkoutobject",
                    "sp_MSenumallsubscriptions",
                    "sp_helpmergealternatepublisher",
                    "sp_MSget_current_activity",
                    "sp_fetchshowcmdsinput",
                    "sp_help_publication_access",
                    "sp_addalias",
                    "sp_MSget_load_hint",
                    "sp_cursorunprepare",
                    "dt_isundersourcecontrol",
                    "sp_MSenumsubscriptions",
                    "sp_dropmergealternatepublisher",
                    "sp_MSset_current_activity",
                    "sp_replshowcmds",
                    "sp_check_constbytable_rowset",
                    "sp_check_publication_access",
                    "sp_dropalias",
                    "sp_getsubscriptiondtspackagename",
                    "sp_reset_connection",
                    "dt_removefromsourcecontrol",
                    "sp_MSenumallpublications",
                    "sp_MScomputemergearticlescreationorder",
                    "sp_MSobjsearch",
                    "sp_article_validation",
                    "sp_MSget_agent_names",
                    "sp_addrole",
                    "sp_MSverifytranfilter",
                    "sp_getschemalock",
                    "dt_validateloginparams",
                    "sp_MSenumtranpublications",
                    "sp_MScomputemergeunresolvedrefs",
                    "sp_MShasdbaccess",
                    "sp_publication_validation",
                    "sp_foreign_keys_rowset",
                    "sp_MSinit_replication_perfmon",
                    "sp_addgroup",
                    "sp_repldropcolumn",
                    "sp_releaseschemalock",
                    "dt_vcsenabled",
                    "sp_MSenummergepublications",
                    "sp_MSCheckmergereplication",
                    "sp_resolve_logins",
                    "sp_marksubscriptionvalidation",
                    "sp_MSrepl_startup",
                    "sp_droprole",
                    "sp_repladdcolumn",
                    "sp_resyncprepare",
                    "dt_whocheckedout",
                    "sp_MSenum3rdpartypublications",
                    "sp_MSgetpubinfo",
                    "sp_MShelpcolumns",
                    "sp_dropanonymousagent",
                    "sp_MSflush_access_cache",
                    "sp_dropgroup",
                    "sp_MSagent_access_check",
                    "sp_resyncexecute",
                    "dt_getpropertiesbyid_vcs_u",
                    "sp_MSenumthirdpartypublicationvendornames",
                    "sp_MSaddmergedynamicsnapshotjob",
                    "sp_MShelpindex",
                    "sp_replrestart",
                    "sp_indexes_rowset",
                    "sp_MSreinit_failed_subscriptions",
                    "sp_addapprole",
                    "sp_enableagentoffload",
                    "sp_resyncexecutesql",
                    "dt_displayoaerror_u",
                    "sp_reinitpullsubscription",
                    "sp_MSdropmergedynamicsnapshotjob",
                    "sp_MShelptype",
                    "sp_MSpub_adjust_identity",
                    "sp_add_datatype_mapping",
                    "sp_approlepassword",
                    "sp_disableagentoffload",
                    "sp_resyncuniquetable",
                    "dt_addtosourcecontrol_u",
                    "sp_addpullsubscription",
                    "sp_MShelpmergedynamicsnapshotjob",
                    "sp_MSdependencies",
                    "sp_helparticledts",
                    "sp_primary_keys_rowset",
                    "sp_MSrepl_gettype_mappings",
                    "sp_setapprole",
                    "sp_getagentoffloadinfo",
                    "sp_refreshview",
                    "dt_checkinobject_u",
                    "sp_MSupdatesharedagentproperties",
                    "sp_MSremove_userscript",
                    "sp_MStablespace",
                    "sp_changesubscriptiondtsinfo",
                    "sp_help_datatype_mapping",
                    "sp_dropapprole",
                    "sp_copysubscription",
                    "sp_user_counter1",
                    "dt_checkoutobject_u",
                    "sp_replicationdboption",
                    "sp_MSdrop_rlrecon",
                    "sp_MSindexspace",
                    "sp_MSdrop_6x_replication_agent",
                    "sp_provider_types_rowset",
                    "sp_MSfix_6x_tasks",
                    "sp_addrolemember",
                    "sp_attachsubscription",
                    "sp_user_counter2",
                    "dt_isundersourcecontrol_u",
                    "sp_MSfixupdistributorinfo",
                    "sp_MSfetchidentityrange",
                    "sp_MStablerefs",
                    "sp_MSreinit_article",
                    "sp_MShelpconflictpublications",
                    "sp_droprolemember",
                    "sp_MSrestore_sub_merge",
                    "sp_user_counter3",
                    "dt_validateloginparams_u",
                    "sp_MSfixupdistributorsecurity",
                    "sp_MScheckidentityrange",
                    "sp_MStablekeys",
                    "sp_MScomputearticlescreationorder",
                    "fn_replgetagentcommandlinefromjobid",
                    "sp_changegroup",
                    "sp_MSrestore_sub_tran",
                    "sp_user_counter4",
                    "dt_whocheckedout_u",
                    "sp_MSfixupftpinfo",
                    "sp_MShelpmergeidentity",
                    "sp_MStablechecks",
                    "sp_MScomputeunresolvedrefs",
                    "sp_procedure_params_rowset",
                    "sp_replproberemoteserver",
                    "sp_change_users_login",
                    "sp_MSrestore_sub",
                    "sp_user_counter5",
                    "sp_generate_inserts",
                    "sp_MSfixupaltsnapshotfolder",
                    "sp_MShelpmergearticles",
                    "sp_MSsettopology",
                    "sp_MShelptranconflictpublications",
                    "sp_MScleanupmergepublisher",
                    "sp_changedbowner",
                    "sp_validatemergepullsubscription",
                    "sp_user_counter6",
                    "sp_MSfixupworkingdirectory",
                    "sp_MShelpmergeschemaarticles",
                    "sp_MSmatchkey",
                    "sp_MShelptranconflictcounts",
                    "sp_MScleanupdynsnapshotvws",
                    "sp_check_removable_sysusers",
                    "sp_MSprepare_sub_for_detach",
                    "sp_user_counter7",
                    "sp_MSfixupuseftp",
                    "sp_MScreateretry",
                    "sp_MSforeach_worker",
                    "sp_MSgettranconflictrow",
                    "sp_procedures_rowset",
                    "sp_MScleanupmergepublisherdb",
                    "sp_changeobjectowner",
                    "sp_MSsub_check_identity",
                    "sp_user_counter8",
                    "sp_MSfixupagentoffloadinfo",
                    "sp_MSdropretry",
                    "sp_MSforeachdb",
                    "sp_MSgettrancftsrcrow",
                    "sp_MShelp_replication_table",
                    "sp_helpsrvrole",
                    "sp_MSsub_cleanup_orphans",
                    "sp_user_counter9",
                    "sp_MSfixupsharedagentproperties",
                    "sp_MSdroptemptable",
                    "sp_MSforeachtable",
                    "sp_MSdeletetranconflictrow",
                    "sp_schemata_rowset",
                    "sp_MScopyscriptfile",
                    "sp_srvrolepermission",
                    "sp_MSsub_cleanup_prop_table",
                    "sp_user_counter10",
                    "sp_addpullsubscription_agent",
                    "sp_MSchangearticleresolver",
                    "sp_MSloginmappings",
                    "sp_MSexternalfkreferences",
                    "sp_repldone",
                    "sp_helpsrvrolemember",
                    "sp_MSreseed",
                    "sp_blockcnt",
                    "sp_helpsubscription_properties",
                    "sp_MSenumretries",
                    "sp_MSuniquename",
                    "sp_MSgetarticlereinitvalue",
                    "sp_statistics_rowset",
                    "sp_repltrans",
                    "sp_helpdbfixedrole",
                    "sp_MSsub_set_identity",
                    "sp_tempdbspace",
                    "sp_change_subscription_properties",
                    "sp_MSdeleteretry",
                    "sp_MSkilldb",
                    "sp_MSispkupdateinconflict",
                    "sp_replcounters",
                    "sp_dbfixedrolepermission",
                    "sp_MSinstance_qv",
                    "sp_dboption",
                    "sp_MSget_pullsubsagent_owner",
                    "sp_MSdeletepushagent",
                    "sp_MSobjectprivs",
                    "sp_ivindexhasnullcols",
                    "sp_tables_rowset",
                    "sp_replcmds",
                    "sp_helprolemember",
                    "sp_MSget_shared_agent",
                    "sp_dbcmptlevel",
                    "sp_droppullsubscription",
                    "sp_MSgetonerow",
                    "sp_MSSQLDMO80_version",
                    "fn_sqlvarbasetostr",
                    "sp_replflush",
                    "sp_helprole",
                    "sp_MSrepl_backup_start",
                    "sp_fallback_MS_sel_fb_svr",
                    "sp_helppullsubscription",
                    "sp_MSuplineageversion",
                    "sp_MSSQLDMO70_version",
                    "sp_replqueuemonitor",
                    "sp_replpostcmd",
                    "sp_helpntgroup",
                    "sp_MSrepl_backup_complete",
                    "sp_validname",
                    "sp_MStable_has_unique_index",
                    "sp_MSgetlastrecgen",
                    "sp_MSSQLOLE65_version",
                    "sp_replsqlqgetrows",
                    "sp_tables_info_rowset",
                    "sp_replpostschema",
                    "xp_logininfo",
                    "sp_MSadd_compensating_cmd",
                    "sp_validlang",
                    "sp_MSchange_retention",
                    "sp_MSgetlastsentgen",
                    "sp_MSSQLOLE_version",
                    "sp_MSpost_auto_proc",
                    "sp_replincrementlsn",
                    "sp_addlinkedserver",
                    "fn_varbintohexstr",
                    "sp_addmessage",
                    "sp_MSchange_priority",
                    "sp_MSgetlastsentrecgens",
                    "sp_MSscriptdatabase",
                    "sp_MSrepl_schema",
                    "sp_replupdateschema",
                    "sp_dropserver",
                    "fn_varbintohexsubstring",
                    "sp_addumpdevice",
                    "sp_expired_subscription_cleanup",
                    "sp_MSdummyupdate",
                    "sp_MSscriptdb_worker",
                    "sp_MSreplupdateschema",
                    "sp_tables_info_rowset_64",
                    "sp_replsetoriginator",
                    "sp_serveroption",
                    "fn_MSsharedversion",
                    "sp_addremotelogin",
                    "sp_addmergepullsubscription",
                    "sp_MSsetlastrecgen",
                    "sp_MSdbuseraccess",
                    "sp_MSdefer_check",
                    "sp_replsetsyncstatus",
                    "sp_addserver",
                    "sp_MSget_setup_paths",
                    "sp_addtype",
                    "sp_changemergepullsubscription",
                    "sp_MSsetlastsentgen",
                    "sp_MSdbuserpriv",
                    "sp_MSreenable_check",
                    "sp_table_constraints_rowset",
                    "sp_replpostsyncstatus",
                    "sp_setnetname",
                    "sp_MSremoveoffloadparameter",
                    "sp_altermessage",
                    "sp_helpmergepullsubscription",
                    "sp_MSenumgenerations",
                    "sp_MShelpfulltextindex",
                    "sp_getqueuedrows",
                    "xp_dsninfo",
                    "sp_helpserver",
                    "sp_MSaddoffloadparameter",
                    "sp_attach_db",
                    "sp_addmergepullsubscription_agent",
                    "sp_MScheckexistsgeneration",
                    "sp_MShelpfulltextscript",
                    "sp_MSprep_exclusive",
                    "sp_table_privileges_rowset",
                    "xp_enumdsn",
                    "sp_helplinkedsrvlogin",
                    "fn_MSgensqescstr",
                    "sp_attach_single_file_db",
                    "sp_MSget_mergepullsubsagent_owner",
                    "sp_MSchecksnapshotstatus",
                    "sp_MSSetServerProperties",
                    "sp_verify_publication",
                    "sp_linkedservers_rowset",
                    "xp_oledbinfo",
                    "sp_addlinkedsrvlogin",
                    "sp_MSUpgradeConflictTable",
                    "sp_helplanguage",
                    "sp_dropmergepullsubscription",
                    "sp_MSenumreplicas",
                    "sp_MSGetServerProperties",
                    "sp_scriptpublicationcustomprocs",
                    "sp_table_statistics_rowset",
                    "xp_repl_encrypt",
                    "sp_droplinkedsrvlogin",
                    "sp_MSsendtosqlqueue",
                    "sp_bindefault",
                    "sp_MSreplraiserror",
                    "sp_MSenumdeletesmetadata",
                    "fn_MSFullText",
                    "sp_MSdrop_rlcore",
                    "xp_repl_convert_encrypt",
                    "sp_fulltext_getdata",
                    "sp_adjustpublisheridentityrange",
                    "sp_bindrule",
                    "sp_check_sync_trigger",
                    "sp_MSenumpartialdeletes",
                    "sp_MSSharedFixedDisk",
                    "sp_MSguidtostr",
                    "xp_repl_help_connect",
                    "sp_fulltext_service",
                    "sp_MSestimatemergesnapshotworkload",
                    "sp_checknames",
                    "sp_check_for_sync_trigger",
                    "sp_MSenumchanges",
                    "sp_MSfilterclause",
                    "sp_MSgetconflicttablename",
                    "sp_oledb_column_constraints",
                    "xp_replproberemsrv",
                    "sp_fulltext_database",
                    "sp_MSestimatesnapshotworkload",
                    "sp_configure",
                    "sp_MSpad_command",
                    "sp_MSenumpartialchanges",
                    "sp_MSgetalertinfo",
                    "sp_MSuniqueobjectname",
                    "sp_MSdrop_repltran",
                    "sp_fulltext_catalog",
                    "fn_serverid",
                    "sp_dbremove",
                    "sp_MSflush_command",
                    "sp_MSinitdynamicsubscriber",
                    "sp_MSsetalertinfo",
                    "sp_MSuniquetempname",
                    "sp_oledb_indexinfo",
                    "sp_MSdrop_pub_tables",
                    "sp_fulltext_table",
                    "sp_MSdropfkreferencingarticle",
                    "sp_create_removable",
                    "sp_MSget_colinfo",
                    "sp_MSgetrowmetadata",
                    "xp_mergexpusage",
                    "sp_MSuniquecolname",
                    "sp_oledb_ro_usrname",
                    "sp_MSarticlecolstatus",
                    "sp_fulltext_column",
                    "sp_addscriptexec",
                    "sp_depends",
                    "sp_MSget_col_position",
                    "sp_MSgetmetadatabatch",
                    "xp_showlineage",
                    "sp_MSaddguidcolumn",
                    "sp_oledb_deflang",
                    "sp_MSarticlecol",
                    "sp_help_fulltext_catalogs",
                    "sp_MSmergeupdatelastsyncinfo",
                    "sp_detach_db",
                    "sp_MSget_map_position",
                    "sp_MSsetrowmetadata",
                    "xp_mergelineages",
                    "sp_MSprepare_mergearticle",
                    "sp_oledb_defdb",
                    "sp_MScreate_pub_tables",
                    "sp_help_fulltext_catalogs_cursor",
                    "sp_MSsetcontext_replagent",
                    "sp_diskdefault",
                    "sp_MSget_type",
                    "sp_MSinsertgenhistory",
                    "xp_mapdown_bitmap",
                    "sp_MSgetcolumnlist",
                    "sp_oledb_database",
                    "sp_MSsetfilterparent",
                    "sp_help_fulltext_tables",
                    "fn_isreplmergeagent",
                    "sp_dropdevice",
                    "sp_MSscript_where_clause",
                    "sp_MSupdategenhistory",
                    "xp_ORbitmap",
                    "sp_MSaddguidindex",
                    "sp_oledb_language",
                    "sp_MSdoesfilterhaveparent",
                    "sp_help_fulltext_tables_cursor",
                    "sp_OACreate",
                    "sp_dropmessage",
                    "sp_MSscript_params",
                    "sp_MSlocalizeinterruptedgenerations",
                    "xp_proxiedmetadata",
                    "sp_MSrefcnt",
                    "sp_tablecollations",
                    "sp_MSsetfilteredstatus",
                    "sp_help_fulltext_columns",
                    "sp_OADestroy",
                    "sp_droptype",
                    "sp_MSscript_procbodystart",
                    "sp_MSenumschemachange",
                    "xp_showcolv",
                    "sp_MSgentablenickname",
                    "sp_bcp_dbcmptlevel",
                    "sp_MSretrieve_publication",
                    "sp_help_fulltext_columns_cursor",
                    "sp_OAGetErrorInfo",
                    "sp_dropremotelogin",
                    "sp_MSscript_begintrig1",
                    "sp_MSenumschemachange_70",
                    "xp_execresultset",
                    "sp_MStablenickname",
                    "sp_MSreplsup_table_has_pk",
                    "sp_trace_getdata",
                    "sp_OAGetProperty",
                    "sp_helpconstraint",
                    "sp_MSscript_begintrig2",
                    "sp_MSenumschemachange_80",
                    "xp_varbintohexstr",
                    "sp_MStablenamefromnick",
                    "sp_replsync",
                    "sp_describe_cursor",
                    "sp_OAMethod",
                    "fn_dblog",
                    "sp_MSscript_endtrig",
                    "sp_MSupdateschemachange",
                    "xp_intersectbitmaps",
                    "sp_MSgetmakegenerationapplock",
                    "sp_enumfullsubscribers",
                    "sp_describe_cursor_columns",
                    "sp_OASetProperty",
                    "fn_helpcollations",
                    "sp_MSscript_trigger_variables",
                    "sp_MSremove_mergereplcommand",
                    "xp_displayparamstmt",
                    "sp_MSreleasemakegenerationapplock",
                    "sp_addpublication",
                    "sp_describe_cursor_tables",
                    "sp_OAStop",
                    "fn_trace_getinfo",
                    "sp_MSscript_trigger_assignment",
                    "sp_MSadd_mergereplcommand",
                    "xp_printstatements",
                    "sp_MSmakegeneration",
                    "sp_changepublication",
                    "sp_cursor_list",
                    "xp_makewebtask",
                    "fn_trace_geteventinfo",
                    "sp_MSscript_trigger_fetch_statement",
                    "sp_MSsetreplicainfo",
                    "xp_createqueue",
                    "sp_MSfixlineageversions",
                    "sp_changesubscription",
                    "xp_dropwebtask",
                    "fn_trace_getfilterinfo",
                    "sp_MSscript_trigger_exec_rpc",
                    "sp_MSsetreplicastatus",
                    "xp_createprivatequeue",
                    "sp_MSaddupdatetrigger",
                    "sp_helparticle",
                    "xp_runwebtask",
                    "fn_trace_gettable",
                    "sp_MSscript_trigger_update_checks",
                    "sp_MScreateglobalreplica",
                    "xp_deletequeue",
                    "sp_MSaddmergetriggers",
                    "sp_MSis_col_replicated",
                    "xp_cleanupwebtask",
                    "fn_servershareddrives",
                    "sp_MSscript_trigger_updates",
                    "sp_MSsetconflictscript",
                    "xp_deleteprivatequeue",
                    "sp_MSchangeobjectowner",
                    "sp_articlecolumn",
                    "xp_enumcodepages",
                    "fn_virtualfilestats",
                    "sp_MSscript_trigger_version_updates",
                    "sp_MSsetconflicttable",
                    "sp_replsendtoqueue",
                    "sp_MShelpdestowner",
                    "sp_helparticlecolumns",
                    "xp_convertwebtask",
                    "fn_virtualservernodes",
                    "sp_MSscript_singlerow_trigger",
                    "sp_MSmakeconflictinsertproc",
                    "sp_replwritetovarbin",
                    "sp_MSfillupmissingcols",
                    "sp_helppublication",
                    "xp_readwebtask",
                    "sp_helpdb",
                    "sp_MSscript_multirow_trigger",
                    "sp_MSmaketempinsertproc",
                    "xp_resetqueue",
                    "sp_MSmaptype",
                    "sp_helpsubscription",
                    "sp_makewebtask",
                    "sp_helpdevice",
                    "sp_MSscript_sync_ins_trig",
                    "sp_MSgetconflictinsertproc",
                    "xp_peekqueue",
                    "sp_MSquerysubtype",
                    "sp_articlefilter",
                    "sp_dropwebtask",
                    "sp_helpfile",
                    "sp_MSscript_sync_upd_trig",
                    "sp_MSinsertdeleteconflict",
                    "xp_controlqueueservice",
                    "sp_showrowreplicainfo",
                    "sp_MSscript_article_view",
                    "sp_runwebtask",
                    "sp_helpfilegroup",
                    "sp_MSscript_sync_del_trig",
                    "sp_MScheckmetadatamatch",
                    "xp_displayqueuemesgs",
                    "sp_MSsethighestversion",
                    "sp_articleview",
                    "sp_cleanupwebtask",
                    "sp_helpgroup",
                    "sp_MSget_synctran_column",
                    "sp_MSdelrow",
                    "xp_decodequeuecmd",
                    "sp_mergemetadataretentioncleanup",
                    "sp_MSaddexecarticle",
                    "sp_enumcodepages",
                    "sp_helplog",
                    "sp_addqueued_artinfo",
                    "sp_MSsetartprocs",
                    "xp_readpkfromqueue",
                    "sp_MSdrop_rladmin",
                    "sp_MSaddschemaarticle",
                    "sp_convertwebtasks",
                    "sp_helplogins",
                    "sp_addsynctriggers",
                    "sp_MSmakesystableviews",
                    "xp_readpkfromvarbin",
                    "sp_MSaddmergepub_snapshot",
                    "sp_addarticle",
                    "sp_readwebtask",
                    "sp_helpindex",
                    "sp_setreplfailovermode",
                    "sp_MSgetchangecount",
                    "xp_makecab",
                    "sp_MSdropmergepub_snapshot",
                    "sp_MSgettranconflictname",
                    "xp_qv",
                    "sp_helpstats",
                    "sp_helpreplfailovermode",
                    "sp_MSbelongs",
                    "xp_unpackcab",
                    "sp_MScheckatpublisher",
                    "sp_MSmaketrancftproc",
                    "sp_MSdrop_replcom",
                    "sp_objectfilegroup",
                    "sp_helpreplicationdboption",
                    "sp_MSexpandbelongs",
                    "sp_MSaddmergeschemaarticle",
                    "xp_regread",
                    "sp_changesubstatus",
                    "sp_MScreate_distributor_tables",
                    "sp_help",
                    "sp_MScheck_agent_instance",
                    "sp_MSexpandnotbelongs",
                    "fn_repltrimleadingzerosinhexstr",
                    "sp_addmergearticle",
                    "xp_regwrite",
                    "sp_addsubscription",
                    "fn_getpersistedservernamecasevariation",
                    "sp_helprotect",
                    "sp_MSBumpupCompLevel",
                    "sp_MSsetupbelongs_withoutviewproc",
                    "fn_replinttobitstring",
                    "sp_MSchangemergeschemaarticle",
                    "xp_regdeletevalue",
                    "sp_MSchangeschemaarticle",
                    "sp_column_privileges",
                    "sp_MSIfExistsRemoteLogin",
                    "sp_helptext",
                    "sp_MSCleanupForPullReinit",
                    "sp_MSsetupnotbelongs",
                    "fn_replbitstringtoint",
                    "sp_changemergearticle",
                    "xp_regaddmultistring",
                    "sp_changearticle",
                    "sp_helppublicationsync",
                    "sp_helpuser",
                    "sp_MSpublicationcleanup",
                    "sp_MSsetupworktables",
                    "fn_replrotr",
                    "sp_MSadjustmergeidentity",
                    "xp_regremovemultistring",
                    "sp_droparticle",
                    "sp_MSreplrole",
                    "sp_indexoption",
                    "sp_cleanupdbreplication",
                    "sp_MSsetupbelongs",
                    "fn_replgenerateshorterfilenameprefix",
                    "sp_helpallowmerge_publication",
                    "xp_regenumkeys",
                    "sp_droppublication",
                    "sp_addpublication_snapshot",
                    "sp_lock",
                    "sp_MSarticlecleanup",
                    "sp_MSaddinitialarticle",
                    "fn_replcomposepublicationsnapshotfolder",
                    "sp_helpmergearticle",
                    "xp_regenumvalues",
                    "sp_dropsubscription",
                    "sp_columns",
                    "sp_MShelpobjectpublications",
                    "sp_getapplock",
                    "sp_MSdroparticleprocs",
                    "sp_MSaddinitialschemaarticle",
                    "sp_MSdroparticleconstraints",
                    "sp_dropmergearticle",
                    "xp_regdeletekey",
                    "sp_subscribe",
                    "sp_helpreplicationdb",
                    "sp_releaseapplock",
                    "sp_MSdroparticletriggers",
                    "sp_msupg_removesystemcomputedcolumns",
                    "sp_MSaddinitialpublication",
                    "sp_MSacquireserverresourcefordynamicsnapshot",
                    "sp_addmergepublication",
                    "xp_instance_regread",
                    "sp_unsubscribe",
                    "sp_databases",
                    "sp_helpdistributor",
                    "sp_logdevice",
                    "sp_mergesubscription_cleanup",
                    "sp_MSaddinitialsubscription",
                    "fn_replgetbinary8lodword",
                    "sp_changemergepublication",
                    "xp_instance_regwrite",
                    "sp_refreshsubscriptions",
                    "sp_enumdsn",
                    "sp_helpremotelogin",
                    "sp_subscription_cleanup",
                    "sp_MSmakearticleprocs",
                    "fn_replprepadbinary8",
                    "sp_helpmergepublication",
                    "xp_instance_regdeletevalue",
                    "sp_MSpublishdb",
                    "sp_enumoledbdatasources",
                    "sp_helpsort",
                    "sp_get_distributor",
                    "sp_MSupdatesysmergearticles",
                    "fn_replmakestringliteral",
                    "sp_dropmergepublication",
                    "xp_instance_regaddmultistring",
                    "sp_MSactivate_auto_sub",
                    "sp_helpsubscriberinfo",
                    "sp_helpsql",
                    "sp_MSrepl_addrolemember",
                    "sp_MSexclause",
                    "sp_MSgettranlastupdatedtime",
                    "sp_mergearticlecolumn",
                    "xp_instance_regremovemultistring",
                    "sp_MSget_synctran_commands",
                    "sp_datatype_info",
                    "sp_replica",
                    "sp_monitor",
                    "sp_MSrepl_droprolemember",
                    "sp_msupg_recreatecatalogfaketables",
                    "sp_MSgetcolordinalfromcolname",
                    "sp_MSgetmergelastupdatedtime",
                    "sp_helpmergearticlecolumn",
                    "xp_instance_regenumkeys",
                    "sp_script_synctran_commands",
                    "sp_addpublisher",
                    "sp_processmail",
                    "sp_table_validation",
                    "sp_msupg_dosystabcatalogupgrades",
                    "sp_MSinsertbeforeimageclause",
                    "sp_MSgetlastupdatedtime",
                    "sp_MSreinitmergepublication",
                    "xp_instance_regenumvalues",
                    "sp_MSaddpub_snapshot",
                    "sp_addsubscriber",
                    "sp_recompile",
                    "sp_removedbreplication",
                    "sp_msupg_dropcatalogcomputedcols",
                    "sp_MSmakeinsertproc",
                    "fn_replquotename",
                    "sp_MSreinit_hub",
                    "xp_instance_regdeletekey",
                    "sp_MSis_pk_col",
                    "sp_addsubscriber_schedule",
                    "sp_remoteoption",
                    "sp_removesrvreplication",
                    "sp_msupg_createcatalogcomputedcols",
                    "sp_MSmakeupdateproc",
                    "fn_chariswhitespace",
                    "sp_reinitmergesubscription",
                    "xp_getprotocoldllinfo",
                    "sp_MSmark_proc_norepl",
                    "sp_fkeys",
                    "sp_changesubscriber",
                    "sp_invalidate_textptr",
                    "sp_MSremovedbreplication",
                    "sp_msupg_recreatesystemviews",
                    "sp_MSmakeselectproc",
                    "fn_generateparameterpattern",
                    "sp_MSpublicationview",
                    "xp_readerrorlog",
                    "sp_MSdrop_expired_subscription",
                    "sp_changesubscriber_schedule",
                    "sp_tableoption",
                    "sp_vupgrade_subscription_databases",
                    "sp_msupg_upgradecatalog",
                    "sp_MSdropconstraints",
                    "fn_skipparameterargument",
                    "sp_addmergesubscription",
                    "sp_readerrorlog",
                    "sp_MSscript_validate_subscription",
                    "sp_distcounters",
                    "sp_procoption",
                    "sp_MScopyregvalue",
                    "sp_MSinsertschemachange",
                    "fn_removeparameterwithargument",
                    "sp_MSretrieve_mergepublication",
                    "xp_enumerrorlogs",
                    "sp_MSvalidate_subscription",
                    "sp_pkeys",
                    "sp_droppublisher",
                    "sp_renamedb",
                    "sp_vupgrade_registry",
                    "sp_MSgetviewcolumnlist",
                    "fn_updateparameterwithargument",
                    "sp_changemergesubscription",
                    "sp_enumerrorlogs",
                    "sp_MSscript_insert_statement",
                    "sp_server_info",
                };

            Array.Sort(spList);
            Array.Reverse(spList);

            return spList;
        }
    }
}